﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.LibrarySys
{
    public class T_PUB_LIBRARYOUTMATERIAL
    {
        private readonly DALL.LibrarySys.T_PUB_LIBRARYOUTMATERIAL dal = new DALL.LibrarySys.T_PUB_LIBRARYOUTMATERIAL();
        public T_PUB_LIBRARYOUTMATERIAL()
        { }

        /// <summary>
        /// 添加出库申请元素
        /// </summary>
        /// <param name="libraryout"></param>
        /// <param name="materiallist"></param>
        public void AddMaterials(Model.LibrarySys.T_PUB_LIBRARYOUT libraryout, IList<Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL> materiallist)
        {
            dal.AddMaterials(libraryout, materiallist);
        }

        /// <summary>
        /// 编辑出库申请元素
        /// </summary>
        /// <param name="libraryout"></param>
        /// <param name="addList"></param>
        /// <param name="editList"></param>
        public void EditMaterials(Model.LibrarySys.T_PUB_LIBRARYOUT libraryout, IList<Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL> addList, IList<Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL> editList)
        {
            dal.EditMaterials(libraryout, addList, editList);
        }
        #region  Method
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int ID)
        {
            return dal.Exists(ID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int ID)
        {

            return dal.Delete(ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL GetModel(int ID)
        {

            return dal.GetModel(ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetListByPid(string strPID)
        {
            string strWhere = string.Format(" LIBRARYOUTID='{0}'", strPID);
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.LibrarySys.T_PUB_LIBRARYOUTMATERIAL> GetModelList(string strPID)
        {
            string strWhere = string.Format(" LIBRARYOUTID='{0}'", strPID);
            return dal.GetListArray(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
        #endregion
    }
}
